package cn.chint;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {

    @Value("${server.port}")
    private int port;

    @Autowired
    private  ApiService apiService;

    private static final Logger logger = LogManager.getLogger(TestController.class);
    @RequestMapping("feign")
    @ResponseBody
    public String feign(){
        logger.info(port);
        String result=null;
        try {
             result = apiService.index2();
        }catch (Exception e){
            result=e.getMessage();
        }
        logger.info(port);

        return result;
    }
}
